/******************************************************************************
*
*  Copyright (C), 2018, Eugene.Chan placetobe@163.com
*
 -----------------------------------------------------------------------------
* @file          : d_key.h
* @brief         : key handle
*
* @author        : eugeneChan
* @mail          : placetobe@163.com
* @date          : 2018/10/6
* @version       : 0.0.0.1
* @license       : GNU General Public License (GPL)
*
* -----------------------------------------------------------------------------
* Change History :
* <Date>     |  <Version>  |  <Author>    |  <Description>
* 2018/10/6  |  0.0.0.01   |  eugeneChan |  Create File
*
******************************************************************************/

#ifndef __D_KEY_H__
#define __D_KEY_H__


#ifdef __cplusplus
#if __cplusplus
extern "C"{
#endif
#endif /* __cplusplus */

/* include files ------------------------------------------------------------*/

/* constans & micro ---------------------------------------------------------*/
#define KEY0_GPIO           GPIOE
#define KEY0_PIN            GPIO_Pin_2
#define KEY1_GPIO           GPIOE
#define KEY1_PIN            GPIO_Pin_3
#define KEY2_GPIO           GPIOE
#define KEY2_PIN            GPIO_Pin_4
//#define KEY3_GPIO           GPIOA
//#define KEY3_PIN            GPIO_Pin_0
#define KEY_WK_GPIO         GPIOA
#define KEY_WK_PIN          GPIO_Pin_0

#define KEY0                PEin(2)
#define KEY1                PEin(3)
#define KEY2                PEin(4)
// #define KEY3                PAin(0)
#define KEY_WK              PAin(0)

#define SMK_PRESS           0x001
#define CLK_PRESS           0x200
#define ALL_KEY_RELEASE    0x201
/* data types ---------------------------------------------------------------*/

/* global variables ---------------------------------------------------------*/

/* function prototypes ------------------------------------------------------*/
extern void key_init(void);
extern void key_int_config(void);
extern void key_scan(void);

#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */


#endif /* __D_KEY_H__ */
